package cn.sumpu.app.guoguojie.biz.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import cn.sumpu.app.guoguojie.biz.CodeBiz;
import cn.sumpu.app.guoguojie.dao.CodeDao;
import cn.sumpu.app.guoguojie.domain.Code;
import cn.sumpu.app.guoguojie.exception.AppBusinessException;

public class CodeBizImpl implements CodeBiz {

	private CodeDao codeDao;

	public void setCodeDao(CodeDao codeDao) {
		this.codeDao = codeDao;
	}

	@Override
	public List<Code> getCodeListByType(String type)
			throws AppBusinessException {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("type", type);
		List<Code> cList = codeDao.getCodeList(map);
		if (cList == null) {
			cList = new ArrayList<Code>();
		}
		return cList;
	}

}
